package file_fragging;

import java.io.*;
import java.util.*;

class Main implements Runnable
{
	static String ReadLn(int maxLength)
	{  
        byte line[] = new byte [maxLength];
        int length = 0;
        int input = -1;
        try{
            while (length < maxLength){
                input = System.in.read();
                if ((input < 0) || (input == '\n')) break; 
                line [length++] += input;
            }

            if ((input < 0) && (length == 0)) return null;  
            return new String(line, 0, length);
        }catch (IOException e){
            return null;
        }
    }
	
	public static void main(String [] args)
	{
		Main stuff = new Main();
		
		stuff.run();
	}
	
	public void run()
	{
		new FileFragmentation().run();
	}
}

class FileFragmentation implements Runnable
{
	public void run()
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		
		try
		{
			// Read the first input, which represents the # of cases.
			int cases = Integer.parseInt(reader.readLine());
			
			for (int count = 0; count < cases; count++)
			{	
				reader.readLine();
				
				ArrayList<String> store = new ArrayList<String>();
				String input = "?";
			
				while (!(input = reader.readLine()).equals(""))
				{
						store.add(input);
				}
				
				String result = fileFragging(store, count);
				
				if (result != null)
				printResult(result, count);
			} 				
		} 
		catch (IOException ex) 
		{
			ex.printStackTrace();
		}
	}
	
	String fileFragging(ArrayList<String> store, int count)
	{
		boolean result = true;
		boolean result2 = true;
		
		if (store.size() > 1)
		{
			for (int index = 0; index < store.size() - 1; index++)
			{
				String binaryCode = store.get(index) + store.get(index + 1);
				String binaryCodeReverse = store.get(index + 1) + store.get(index);
				
				result = true;
				result2 = true;
				
				for (int sIndex = 0; sIndex < store.size(); sIndex++)
				{
					String binaryFragment = store.get(sIndex);
					
					if (!binaryCode.contains(binaryFragment))
					{
						result = false;
						break;
					} 
				}
				
				for (int sIndex = 0; sIndex < store.size(); sIndex++)
				{
					String binaryFragment = store.get(sIndex);
					
					if (!binaryCodeReverse.contains(binaryFragment))
					{
						result2 = false;
						break;
					} 
				}
				
				if (result == true)
				{
					return binaryCode;
				} 
				else if (result2 == true)
				{
					return binaryCodeReverse;
				}
			}
		}
		return store.get(0);
	}
	
	void printResult(String value, int count)
	{
		System.out.print(value);
	}
}